[16.0] [FIX] membership_prorate: fix for calculating quantity for prorate products #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tends to solve quantity calculations for prorate products.Consider the following scenario:
Define a membership product with fixed dates, set start date as 1st Feb 2024 and end date as 29th Feb 2024, then create an invoice ,set 1st Feb 2024 as start date and select the product and save.Ideally the qty should be set as 1, but its sets it as 0.97 without changes added in this PR.
Also, changes in test scripts were needed for prorate variable period as for a week, if we consider from Thursday, it would be 4 days including Thursday(Thursday,Friday,Saturday and Sunday) i.e 4/7 = approximately 57% and similarly for the month - its 16 days including 15th April so 16/30 =approximately 53%